import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import uView from './uni_modules/uview-ui';
Vue.use(uView)
uni.$u.config.unit = 'rpx'

import store from './store'
Vue.prototype.$store = store

 //配置公共方法
 import common from './common/common.js'
 Vue.prototype.$noMultipleClicks = common.noMultipleClicks;

//权限跳转
Vue.prototype.navigateTo = (options)=>{
	if( !uni.getStorageSync('token') ){
		uni.showToast({
			title:"请先登录",
			icon:"none"
		})
		return	uni.navigateTo({
				url:"/pages/login/login"
			})
	}
	uni.navigateTo(options)
}
//导入封装的请求对象
import api from './api/index.js'
//将请求对象设置为全局属性
Vue.prototype.$api = api

import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store,
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif